package com.twu.biblioteca.elements;

public class Movie {
    private String name;
    private int year;
    private String director;
    private int rating;
    private boolean available;
    private User owner;

    public String getName() {
        return name;
    }

    public int getYear() {
        return year;
    }

    public String getDirector() {
        return director;
    }

    public int getRating() {
        return rating;
    }

    public boolean isAvailable() {
        return available;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    public static class Builder {
        Movie movie = new Movie();

        public Builder name(String name) {
            movie.name = name;
            return this;
        }

        public Builder year(int year) {
            movie.year = year;
            return this;
        }

        public Builder director(String director) {
            movie.director = director;
            return this;
        }

        public Builder rating(int rating) {
            movie.rating = rating;
            return this;
        }

        public Builder isAvailable(boolean isAvailable) {
            movie.available = isAvailable;
            return this;
        }

        public Movie build() {
            return movie;
        }
    }
}
